package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.mapper.CompensationInfoMapper;
import cn.wolfcode.crm.query.DamageQueryObject;
import cn.wolfcode.crm.query.PageResult;
import cn.wolfcode.crm.service.ICompensationInfoService;
import cn.wolfcode.crm.util.PermissionName;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("damage")
public class DamageController {

    @Autowired
    private ICompensationInfoService iCompensationInfoService;



    @RequestMapping("")
    @PermissionName("事故赔损表页面")
    @RequiresPermissions("damage:index")
    public String index(){
        return "damage/list";
    }



    @PermissionName("赔损表数据")
    @RequiresPermissions("accident:list")
    @RequestMapping("list")
    @ResponseBody
    private PageResult list(DamageQueryObject qo){

        return iCompensationInfoService.query(qo);
    }
}
